package example;

import java.util.Scanner;

class University{
    double chinese;
    double math;
    double english;
    double sum;

    University(double chinese,double math,double english){
        this.chinese = chinese;
        this.math = math;
        this.english = english;
        this.sum=chinese+math+english;
        System.out.println("总分:"+sum);
    }
     void enterRule(){
        if(sum>200)
            System.out.println("达到录取线");
        else
            System.out.println("不够资格，继续努力。");
    }

    void Congratulation(){
        System.out.println("恭喜");
    }

    static void Frighting(){
        System.out.println("继续加油！");
    }

}

class ImportantUniversity extends University{
    String universitytypt;

    ImportantUniversity(double chinese,double math,double english){
        super(chinese,math,english);
    }

     void enterRule(){       //重写
        if(sum>240) {
            System.out.println("欢迎报考！！！");
            Congratulation();
        }
        else
            System.out.println("不够资格，继续努力。");
    }

}

public class Example_1 {
    public static void main(String[] args) {
        Scanner reader = new Scanner(System.in);
        double chinese = reader.nextDouble();
        double math = reader.nextDouble();
        double english = reader.nextDouble();


        ImportantUniversity p1 = new ImportantUniversity(chinese,math,english);
        p1.enterRule();
        p1.Congratulation();
    }
}
